#ifndef __CODE4_MOTION_H
#define __CODE4_MOTION_H

////////////////////////////////////////////////////////////////////////////////////////////////////
// Defination for motion mode
////////////////////////////////////////////////////////////////////////////////////////////////////
#define NO_MOTION				 0
#define POS_STAND_NOHEAD 48
#define POS_STAND        49
// Continuous Moiton
#define STOP        100
#define STEP        101
#define SHIFT       102
#define TURN        103
#define TURNBALL    104
#define WALK        105
#define WALK_RAISEARM	106

// Fall down
#define TORQUEOFF   254
#define GETINGUP    255		
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////		 
typedef struct
{
	unsigned char Mode;
	unsigned char Mode_RX; 
	unsigned char Mode_Past;
	unsigned char Doing; // Tell the computer which motion is doing 
											 // 0 for done, others for doing the motion
	Bool Replaceable; // if motion_mode > 110 
										// which means the motion must be done finish and 
										// can't replaced by following motion_mode_RX 

	Bool Continue_Eanble;
	unsigned char Continue_Set;

	float ContinueAngle;
	float ContinueDistance;
	float ContinueAngle_Past;
	float ContinueDistance_Past;
	float ContinueAngle_RX;
	float ContinueDistance_RX;

	int DoneX;
	int DoneY;
	int DoneAngle;
	
	MotionStateStatus StateMode;
} MotionStruct;												 
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
void Motion_Init(void);
void SingleMotion(void);
void ContinuousMotion(void);
void Mtn_POSE_Standing(int speedL, int speedH, int steptime);
void Mtn_POSE_Standing_Nohead(int speedL, int speedH, int steptime);

#endif // __Code4_MOTION_H

